<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>Document</title>
  <style>
    body {
      margin: 0;
      padding: 0;
    }
    h1 {
      white-space: nowrap;
      overflow: hidden;
      width: 0;
      font-size: 30px;
      animation: typeWords 5s steps(10) infinite;
    }
    @keyframes typeWords {
      from {
        width: 0;
      }
      to {
        width: 300px;
      }
    }
  </style>
</head>
<body>
  <h1>打字机效果了解一下</h1>
</body>
</html>